Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Canvas | +--com.pacist.diamonds.DiamondCanvas | +--com.pacist.diamonds.Controller | +--com.pacist.diamonds.LinearController
Field Summary | |
boolean | hasPeer
A boolean variable which records whether a peer has been assigned to this component. |
static int | HORIZONTAL
Specifies horizontal orientation for a Slider |
int | orientation
Holds the current orientation of the controller. |
int | thumbSize
The size of the button you drag to change the value. |
java.awt.Rectangle | trackRect
This holds the dimensions of the rectangle which is the background of the controller. |
java.awt.Rectangle | valueRect
This holds the dimensions of the rectangle which shows the current value of the controller. |
static int | VERTICAL
Specifies vertical orientation for a Slider |
Fields inherited from class com.pacist.diamonds.Controller | |
canMeasure, listeners, maxValue, minValue, postOnMouseDown, postWhileDragging, showValue, value |
Fields inherited from class com.pacist.diamonds.DiamondCanvas | |
tipText |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Constructor Summary | |
LinearController(int min,
int max,
int initial,
int o)
Creates and initializes a LinearController object with the specified minimum, maximum, initial, and orientation values. |
|
LinearController()
Creates and initializes a LinearController object with a minimum value of 0, a maximum value of 100, an initial value of 0, and a horizontal orientation. |
Method Summary | |
void | addNotify()
This method is called when the Controller has been given it's peer and has been realised. |
void | doValueAtEndLayout()
Lays out the controller with the value at the end. |
java.awt.Dimension | getMinimumSize()
Returns the minimum size of the Controller. |
int | getOrientation()
Gets the current orientation of the controller |
java.awt.Dimension | getPreferredSize()
Returns the preferred size of the Controller. |
java.awt.Rectangle | getThumbRect()
Returns the dimensions of the Thumb rectangle. |
java.awt.Rectangle | getTrackRect()
Returns the dimensions of the Track rectangle. layoutAreas() is called beforehand to use the latest values. |
java.awt.Color | getValueColor()
Returns the color of the Value. |
java.awt.Point | getValuePos()
Returns an x,y coordinate for the position of the numeric value displayed. |
java.awt.Rectangle | getValueRect()
Returns the dimensions of the Value rectangle. |
void | layoutAreas()
Calls the necessary methods to lay out the controller. |
java.awt.Dimension | minimumSize()
Deprecated. Returns the minimum size of the Controller. |
void | paint(java.awt.Graphics g)
This method is called to repaint the controller. |
void | paintThumb(java.awt.Graphics g)
Draws the thumb of the slider. |
void | paintTrack(java.awt.Graphics g)
Draws the track of the slider. |
void | paintValue(java.awt.Graphics g)
Draws the value of the slider. |
void | paintValueOneColor(java.awt.Graphics g)
Draws the value of the slider in one color (the normal case when the value is positioned outside the track) |
int | pointToValue(int x,
int y)
Converts given X and Y coordinates to a value. |
java.awt.Dimension | preferredSize()
Deprecated. Returns the preferred size of the Controller. |
void | repaintPostValueChange(java.awt.Rectangle oldThumb,
java.awt.Rectangle newThumb)
This method is called whenever the value of the Controller changes. |
void | setBounds(int x,
int y,
int width,
int height)
Moves and resizes the controller. |
void | setOrientation(int o)
Sets the orientation of the controller. |
void | setValue(int v)
Sets the value of the slider, causing it to be redrawn. |
int | valueToX(int v,
java.awt.Rectangle r)
Converts a given value and Rectangle to an X coordinate. |
Methods inherited from class com.pacist.diamonds.Controller | |
addControllerListener, getMaxValue, getMinValue, getPostOnMouseDown, getShowValue, getValue, getValueString, isMaxAtBottom, mouseDragged, mousePressed, mouseReleased, notifyValueChange, pinValue, pointToValue, processMouseEvent, processMouseMotionEvent, removeControllerListener, setMaxAtBottom, setMaxValue, setMinValue, setPostOnMouseDown, setShowValue, setValue |
Methods inherited from class com.pacist.diamonds.DiamondCanvas | |
getTipText, mouseEnter, mouseExit, processMouseEvent, setTipText |
Methods inherited from class java.awt.Canvas | |
addNotify, paint |
Methods inherited from class java.awt.Component | |
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
public static final int HORIZONTAL
public static final int VERTICAL
protected int thumbSize
protected int orientation
protected java.awt.Rectangle valueRect
protected java.awt.Rectangle trackRect
protected boolean hasPeer
Constructor Detail |
public LinearController(int min, int max, int initial, int o)
min
- the minimum value for the controller.
max
- the maximum value for the controller.
initial
- the initial value for the controller.
o
- the orientation of the controller.public LinearController()
Method Detail |
public abstract void repaintPostValueChange(java.awt.Rectangle oldThumb, java.awt.Rectangle newThumb)
oldThumb
- thumb coordinates before change
newThumb
- thumb coordinates after changepublic void setValue(int v)
v
- the new value.public void setOrientation(int o)
o
- the orientation.public int getOrientation()
int
- the orientation of the controller.public java.awt.Dimension getPreferredSize()
Dimension
- the size of the controller.public java.awt.Dimension preferredSize()
public java.awt.Dimension getMinimumSize()
Dimension
- the minimum size of the controller.public java.awt.Dimension minimumSize()
protected abstract void paintTrack(java.awt.Graphics g)
g
- the graphics context.protected abstract void paintThumb(java.awt.Graphics g)
g
- the graphics context.protected java.awt.Color getValueColor()
protected java.awt.Point getValuePos()
protected void paintValue(java.awt.Graphics g)
g
- the graphics context.protected void paintValueOneColor(java.awt.Graphics g)
protected void layoutAreas()
doValueAtEndLayout()
.protected void doValueAtEndLayout()
protected java.awt.Rectangle getTrackRect()
Rectangle
- the dimensions of the track rectangle.protected abstract java.awt.Rectangle getThumbRect()
protected java.awt.Rectangle getValueRect()
protected int valueToX(int v, java.awt.Rectangle r)
v
- given value.
r
- the rectangle the value resides in.int
- the X coordinate which lies inside the given rectangle.protected int pointToValue(int x, int y)
x
- the X coordinate
y
- the Y coordinateint
- a value derived from the above coordinates, the Track rectangle, and the minimum and maximum values.public void paint(java.awt.Graphics g)
g
- the graphics context.public void setBounds(int x, int y, int width, int height)
x
and y
, and the
new size is specified by width
and height
.
x
- The new x-coordinate of the controller.
y
- The new y-coordinate of the controller.
width
- The new width
of the controller.
height
- The new height
of the
controller.public void addNotify()
Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |